package com.example.redisdemo.queue;

import com.sun.jmx.remote.internal.ArrayQueue;

import java.util.ArrayDeque;
import java.util.concurrent.atomic.AtomicBoolean;

/**
 * arrayqueue队列测试
 *
 * @author hexinglin
 * @created 2022-06-13 13:53
 **/
public class ArrayQueueDemo {
    private final AtomicBoolean isShutdown = new AtomicBoolean();

    ArrayQueueDemo(){
        isShutdown.set(true);
        System.out.println(this);
    }
    public static void main(String[] args) {
        ArrayDeque<Integer> arrayQueue = new ArrayDeque<>();
        for (int i = 0; i < 10; i++) {
        //    arrayQueue.add(i);
         //   arrayQueue.push(i);
            arrayQueue.addLast(i);
        }
        System.out.println(arrayQueue.peek());
        System.out.println(arrayQueue.pop());
        System.out.println(arrayQueue.poll());
        System.out.println(arrayQueue.getLast());
        System.out.println(arrayQueue.poll());
        ArrayQueueDemo arrayQueueDemo = new ArrayQueueDemo();
    }
}
